/* App Grid */

$app_icon_size: 96px;
$app_folder_size: 720px;

// app icons
.icon-grid {
  row-spacing: 12px;
  column-spacing: 12px;
  max-row-spacing: 36px;
  max-column-spacing: 36px;
  page-padding-top: 24px;
  page-padding-bottom: 24px;
  page-padding-left: 18px;
  page-padding-right: 18px;
}

/* App Icons */

// items in the app grid and dash
.overview-tile {
  border-radius: $menu_radius * 3;
  padding: 12px;
  spacing: 6px;
  transition-duration: $longer_duration;
  text-align: center;
  background-color: transparent;
  color: $inverse_fg_color;
  border: 1px solid transparent;
  box-shadow: inset 0 1px transparent;

  &:hover,
  &:focus,
  &:highlighted,
  &:selected {
    background-color: $inverse_divider_color;
    color: $inverse_fg_color;
    transition-duration: 0ms;
    border-image: none;
    background-image: none;

    @if $window == 'round' {
      border: 1px solid $icon_border_color;
      box-shadow: inset 0 1px $icon_highlight_color;
    }
  }

  &:active,
  &:checked {
    background-color: $inverse_divider_color;
    transition-duration: $longer_duration;
    color: $inverse_fg_color;

    @if $window == 'round' {
      border: 1px solid $icon_border_color;
      box-shadow: inset 0 1px $icon_highlight_color;
    }
  }

  // the icon itself
  .overview-icon {
    // item with a label
    &.overview-icon-with-label {
      > StBoxLayout {
        spacing: $container_padding;
      }
    }
  }
}

// app folders
.app-folder {
  background-color: $inverse_bg_color;

  &:focus { background-color: $inverse_divider_color; }
  &:hover { background-color: $inverse_divider_color; }
  &:active { background-color: $inverse_track_color; }
  &:highlighted,&:selected,
  &:checked { background-color: $inverse_track_color; }
  &:insensitive { background-color: transparent; }
}

// Running app indicator (also shown in dash)
.app-grid-running-dot {
  width: 6px; height: 3px;
  border-radius: 2px;
  background-color: $inverse_hint_fg_color;
  margin-bottom: 1px;
}

StWidget.focused {
  .app-grid-running-dot {
    width: 18px;
    background-color: $primary_color;
  }
}

.app-folder-dialog-container {
  // pad the top with panel height so the folder doesn't overlap the panel on smaller resolutions
  @if $panel_style == 'compact' {
    padding-top: $medium_size - 2px;
  } @else {
    padding-top: $medium_size + 2px;
  }
}

// expanded folder
.app-folder-dialog { //style like the dash
  width: $app_folder_size;
  height: $app_folder_size;
  border-radius: $buttons_radius * 4;
  background-color: rgba(#222, 0.95);
  color: white;

  @if $window == 'round' {
    border: 1px solid $icon_border_color;
    box-shadow: inset 0 1px $icon_highlight_color;
  } @else {
    border: none;
    box-shadow: none;
  }

  & .folder-name-container {
    padding: 24px 36px 0;
    spacing: 12px;

    & .folder-name-label,
    & .folder-name-entry {
      font-size: 18pt;
      font-weight: 800;
    }

    & .folder-name-entry {
      border: none;
      color: $light_fg_color;
      background-color: rgba(white, 0.15);
      caret-color: $light_fg_color;
      selection-background-color: $primary_color;
      selected-color: $light_fg_color;
      width: 300px;

      &:focus {
        color: $light_fg_color;
        background-color: rgba(white, 0.25);
      }

      .search-entry-icon { color: rgba(white, 0.85); }

      &:hover, &:focus {
        .search-entry-icon { color: rgba(white, 0.95); }
      }

      &:insensitive, StLabel.hint-text {
        color: rgba(white, 0.45);
      }
    }

    /* FIXME: this is to keep the label in sync with the entry */
    & .folder-name-label {
      padding: 5px 7px;
      color: $inverse_secondary_fg_color;
    }

    & .icon-button {
      background-color: $inverse_fill_color;
      color: $inverse_secondary_fg_color;
      border: none;

      padding: 0;
      width: 36px;
      height: 36px;
      border-radius: 18px;

      & > StIcon { icon-size: 16px }

      &:hover { background-color: $inverse_divider_color; }
      &:focus { border: none !important; box-shadow: none !important;  outline: none !important; }
      &:checked, &:active { background-color: $inverse_track_color; }
    }
  }

  & .icon-grid {
    row-spacing: 12px;
    column-spacing: 30px;
    page-padding-top: 0;
    page-padding-bottom: 0;
    page-padding-left: 0;
    page-padding-right: 0;
  }

  & .page-indicators {
    margin-bottom: 18px;
  }
}

// Rename popup for app folders
.rename-folder-popup {
  .rename-folder-popup-item {
    spacing: $container_padding;

    &:ltr, &:rtl { padding: 0 $container_padding * 2; }
  }
}

// right-click app menu
.app-menu,
.app-well-menu {
  max-width: 27.25em;
}

// App Grid pagination indicators
.page-indicator {
  padding: $container_padding $container_padding * 2 0;

  .page-indicator-icon {
    width: 10px;
    height: 10px;
    border-radius: 10px; // the same as height&width
    background-color: white;
    transition-duration: 400ms;
  }
}

.apps-scroll-view {
  padding: 0;
}

// shutdown and other actions in the grid
.system-action-icon {
  background-color: rgba(0,0,0,0.8);
  color: white;
  border-radius: $circular_radius;
  icon-size: 8px;
}

.page-navigation-hint {
  &.dnd {
    background: rgba(255, 255, 255, 0.1);
  }

  &.next:ltr,
  &.previous:rtl {
    background-gradient-start: rgba(255, 255, 255, 0.05);
    background-gradient-end: transparent;
    background-gradient-direction: horizontal;
    border-radius: 15px 0px 0px 15px;
  }

  &.previous:ltr,
  &.next:rtl {
    background-gradient-start: transparent;
    background-gradient-end: rgba(255, 255, 255, 0.05);
    background-gradient-direction: horizontal;
    border-radius: 0px 15px 15px 0px;
  }
}

.page-navigation-arrow {
  margin: 6px;
  padding: 18px;
  width: 24px;
  height: 24px;
  border-radius: $circular_radius;
  color: $inverse_secondary_fg_color;
  background-color: transparent;

  > StIcon { color: $inverse_fg_color; }

  &:insensitive {
    background-color: rgba(white, 0.05);
    color: rgba(white, 0.45);
  }

  &:hover {
    background-color: rgba(white, 0.1);
    color: white;
  }

  &:active {
    background-color: rgba(white, 0.2);
    color: white;
  }
}
